import java.util.Scanner;

/**
 * @author caesar
 * @date 2025/6/30
 * @apiNote
 */
//从键盘分别输入年、月、日，使用循环for+if实现，判断这一天是当年的第几天
public class homework1_3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入年份：");
        int year = input.nextInt();
        System.out.print("请输入月份：");
        int month = input.nextInt();
        System.out.print("请输入日期：");
        int day = input.nextInt();
        int sum = day;

        for (int i = 1; i < month; i++) {
            if (i == 1 || i == 3 || i == 5 || i == 7 || i == 8 || i == 10 || i == 12)
                sum += 31;
            if (i == 2)
                sum += (year % 4 == 0 && year % 100 != 0 || year % 400 == 0 ? 29 : 28);
            if (i == 4 || i == 6 || i == 9 || i == 11)
                sum += 30;
        }
        System.out.println("总天数为：" + sum);
        input.close();
    }
}
